
#pragma once

#include "technique.h"

namespace EggNine {

// Gaussian with radius of 1, variable weights
class WaveSolveTechnique : public IProgram {
protected:
    GLuint  m_GaussianProgramId;
    GLuint  m_waveProgramId;
    GLuint  m_tmpTex;
    GLsizei m_maxWidth, m_maxHeight;
    mutable GLsizei m_width, m_height;

    GLint   m_uniformDir;
    GLint   m_uniformSizeRatio;

    GLuint  m_vao;
    GLuint  m_vbo;

    GLuint  m_fbo;

    void ResetStateToProgram() const;
    void GetActiveUniforms(const UniformMap& uBlocks);
    void MapTextures() const;
public:
    WaveSolveTechnique(GLsizei maxWidth, GLsizei maxHeight);
    ~WaveSolveTechnique();

    void DrawPass(int pass=0) const;
    void AttachGlobalUniforms(const UniformMap& uBlocks);
    void SetTextureSize(GLsizei width, GLsizei height) const;
};

} // EggNine
